<?php include '../nav.php';
	$pid = ($_SESSION['home']['id']);
	// var_dump($pid);exit;

	// $prid= ($_GET($pid));
	// var_dump($prid);exit; 
	// var_dump($_SESSION['home']);exit;
	$sql = 'select `icon`, `tel`, `nickname`, `sex` ,`email`
			from user
			where id='.$pid.'';
	// var_dump($sql);exit; 

	$per_list = query($sql)[0];
	// var_dump($per_list);exit; 
	// var_dump(query($sql)[0]);


 ?>

<link rel="stylesheet" href="<?= CSS?>space.css">

	<div id='main'>
		<div class='member_left'>
			<h3>
				<a href="<?= URL?>404.php">个人中心</a>
			</h3>
			<div class='order'>
				<h4>我的订单</h4>
				<ul>
					<li><a href="receive.php">待收货</a></li>
					<li><a href="pay.php">待付款</a></li>
					<li><a href="orders.php">全部订单</a></li>
				</ul>
			</div>
			<div class='order'>	
				<h4>账号信息</h4>
				<ul>
					<li><a href="personal.php">个人资料</a></li>
					<li class='receiving'><a href="alter.php">修改密码</a></li>
				</ul>
			</div>
		</div>
		<div class='member_right'>
			<h4>个人资料</h4>
			<div class='personal'>

			<?php if(empty($per_list)): ?>
			<tr><td>您还没有登录....</td></tr>

		<?php else: ?>

				<dl>
					<dt>头像 : </dt>
					<dd><img src="<?= img_url($per_list['icon'],240)?>" width='50px'></dd>
				</dl>
				<dl>
					<dt>用户名 : </dt>
					<dd><?= $per_list['tel']?></dd>
				</dl>
				<dl>
					<dt>昵称 : </dt>
					<dd><?= $per_list['nickname'] ?></dd>
				</dl>
				<dl>
					<dt>性别 : </dt>
					<dd><?= $per_list['sex']==1?'男':'女';?></dd>
				</dl>
				<dl>
					<dt>邮箱 : </dt>
					<dd><?= $per_list['email'] ?></dd>
				</dl>
				<dl>
					<dt></dt>
					<dd><a href="edit.php"  class='update_btn'>编辑资料</a></dd>
				</dl>
			
		<?php endif; ?>
				
			</div>
		</div>
	</div>

<?php include '../foot.php' ?>

	